const app = getApp();
const db = wx.cloud.database();
const _ = db.command
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    showtab: 0,

  },

  /**
   * 组件的方法列表
   */
  methods: {
    changeTab(e) {
      this.setData({
        showtab: e.currentTarget.dataset.index
      })
    },
    getWinningNumbers() {
      wx.cloud.callFunction({
        name: 'lottery',
        data: {
          op: 'getLottery'
        }
      }).then(res => {
        console.log('lottery', res)
        this.setData({
          winData: res.result.winData,
          buyData: res.result.buyData
        })
      })
    },



  },
  ready: function () {
    this.getWinningNumbers()
  }

})